package com.sxt.sys.utils;

import com.sxt.sys.constast.SysConstast;

public class ResultObj {

	private Integer code;
	private String msg;
	
	/**
	 * 删除
	 * @return
	 */
	public static ResultObj deleteOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_DELETE_SUCCESS);
	}
	public static ResultObj deleteError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_DELETE_ERRER);
	}
	/**
	 * 添加
	 * @return
	 */
	public static ResultObj addOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_ADD_SUCCESS);
	}
	public static ResultObj addError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_ADD_ERRER);
	}
	/**
	 * 修改
	 * @return
	 */
	public static ResultObj updateOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_UPDATE_SUCCESS);
	}
	public static ResultObj updateError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_UPDATE_ERRER);
	}
	
	/**
	 * 是否有子节点
	 */
	public static ResultObj childrenOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_UPDATE_SUCCESS);
	}
	public static ResultObj childrenError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_UPDATE_ERRER);
	}
	/**
	 * 分配权限
	 */
	public static ResultObj assignOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_PERMISSION_SUCCESS);
	}
	public static ResultObj assignError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_PERMISSION_ERROR);
	}
	/**
	 * 重置
	 */
	public static ResultObj resetOk() {
		return new ResultObj(SysConstast.CODE_OK, SysConstast.OPERATE_RESET_SUCCESS);
	}
	public static ResultObj resetError() {
		return new ResultObj(SysConstast.CODE_ERROR, SysConstast.OPERATE_RESET_ERROR);
	}
	
	public ResultObj() {
		super();
	}
	public ResultObj(Integer code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	
	
}
